#[allow(dead_code)]
pub struct AppProxy(pub(crate) ndkm::Sender<i64>);
impl types::AppProxy for AppProxy {
	#[allow(unused_variables)]
	fn wake(&self, id: i64) {
		#[cfg(not(target_arch = "wasm32"))]
		self.0.send(id).ok();
	}
}

pub struct AppCmd(pub ndkm::Recver<i64>);
impl ndkm::LooperHandler for AppCmd {
	fn on(&self, _fd: core::ffi::c_int) {
		#[cfg(not(target_arch = "wasm32"))]
		if let Ok(cmd) = self.0.recv() {
			crate::win::with_wins(|vars| {
				for (_, win) in vars.iter() {
					win.rep().unwrap().on_proxy(win.win_ref(), cmd)
				}
			})
		}
	}
}
